import React from "react";
import { Layout } from "antd";
import { useSelector } from "react-redux";
import styled from "styled-components";

const { Content } = Layout;

const StyledContent = styled(Content)`
  background-color: ${(props) => props.theme.backgroundColor};
  color: ${(props) => props.theme.textColor};
  padding:15px
`;

const AppContent = ({ children }) => {
  const { currentTheme } = useSelector((state) => state.layout);

  return <StyledContent theme={currentTheme}>{children}</StyledContent>;
};

export default AppContent;
